//
//  AppMarco.h
//  Eventor
//
//  Created by guojiang on 14-5-13.
//  Copyright (c) 2014年 DaCheng. All rights reserved.
//

#ifndef Eventor_AppMarco_h
#define Eventor_AppMarco_h
#import <objc/runtime.h>


#pragma mark - 发布有关的设置




//////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark - 代码简写

#define AppVersionNumber                        [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
#define AppName                                 [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey]
#define DeviceName                              [[UIDevice currentDevice] name]
#define DeviceModel                             [[UIDevice currentDevice] systemName]
#define DeviceVersion                           [[UIDevice currentDevice] systemVersion]
#define URLFromString(str)                      [NSURL URLWithString:str]
#define StringFormat(str)                       [NSString stringWithFormat:@"%@",str]


#pragma mark - 界面有关的宏


#define SIZE_TextSmall                          10.0f
#define SIZE_TextContentNormal                  13.0f
#define SIZE_TextTitleMini                      15.0f
#define SIZE_TextTitleNormal                    17.0f
#define SIZE_TextTitleLarge                     20.0f
#define SIZE_TextLarge                          16.0f
#define SIZE_TextHuge                           18.0f



#pragma mark - 常用颜色

#define NavgationBarBackgroundColor   RGB(79, 153, 68)
#define COLOR_BASE                    RGB(95, 166, 86)
#define COLOR_GRAY                    RGB(161,161, 161)

#define SeparatorLineColor  ([UIColor colorWithHexString:@"#a1a1a1"])


#define SYNTHESIZE_CATEGORY_OBJ_PROPERTY(propertyGetter, propertySetter)\
- (id) propertyGetter {\
return objc_getAssociatedObject(self, @selector( propertyGetter ));\
}\
- (void) propertySetter (id)obj{\
objc_setAssociatedObject(self, @selector( propertyGetter ), obj, OBJC_ASSOCIATION_RETAIN_NONATOMIC);\
}

#define SYNTHESIZE_CATEGORY_VALUE_PROPERTY(valueType, propertyGetter, propertySetter)\
- (valueType) propertyGetter {\
valueType ret = {0};\
[objc_getAssociatedObject(self, @selector( propertyGetter )) getValue:&ret];\
return ret;\
}\
- (void) propertySetter (valueType)value{\
NSValue *valueObj = [NSValue valueWithBytes:&value objCType:@encode(valueType)];\
objc_setAssociatedObject(self, @selector( propertyGetter ), valueObj, OBJC_ASSOCIATION_RETAIN_NONATOMIC);\
}



typedef NS_ENUM(NSInteger,NetType)
{
    NetTypeNone,
    NetTypePPPOE,
    NetTypeIP,
    NetTypeDHCP,
};
#endif
